package com.lx.pc.service.wreceiptOrder.impl;

import java.math.BigInteger;
import java.util.List;

import org.springframework.stereotype.Service;

import com.lx.pc.domain.entity.wreceiptorder.WReceiptOrderEntity;
import com.lx.pc.domain.vo.wreceiptorder.WReceiptOrderVo;
import com.lx.pc.mybatis.repository.wreceiptorder.WReceiptOrderRepository;
import com.lx.pc.service.AbstractService;
import com.lx.pc.service.wreceiptOrder.IWReceiptOrderService;
import com.lx.pc.utils.OmsPage;

@Service("wReceiptOrderService")
public class WReceiptOrderServiceImpl extends AbstractService<WReceiptOrderEntity, WReceiptOrderVo, BigInteger, WReceiptOrderRepository> implements IWReceiptOrderService{

	@Override
	public int findByWReceiptOrderCount(WReceiptOrderVo receiptOrderEntity) {

		return repository.findByWReceiptOrderCount(receiptOrderEntity);
	}

	@Override
	public OmsPage<WReceiptOrderVo> findByWReceiptOrder(WReceiptOrderVo receiptOrderEntity, Integer page,
			Integer size) {
		OmsPage<WReceiptOrderVo> pages = new OmsPage<WReceiptOrderVo>();
		pages.setTotal(repository.findByWReceiptOrderCount(receiptOrderEntity));
		List<WReceiptOrderEntity> list = repository.findByWReceiptOrder(receiptOrderEntity,page = (page - 1) * size,size);
		pages.setResult(etoV(list));
		return pages;
	}

}
